<%
// courselist.jsp 
%>

<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <%@ page import="course.Course" %>
    <%@ page import="java.text.*" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>課程登記</title>
</head>
<center>
<h1>課程清單</h1>
<body>
<jsp:useBean id="couList" scope="request" type="java.util.List"></jsp:useBean>

<table border=1 id="courselisttable">

<tr bordercolor="#6894D5">
	<td height="24" width=180><div align="center" class="style2">課程編號</div></td>
	<td width=150><div align="center" class="style2"><a href='courselist?ord=2'>課程名稱</a></div></td>
	<td width=150><div align="center" class="style2"><a href='courselist?ord=3'>課程類別</a></div></td>
	<td width=150><div align="center" class="style2">開始日期</div></td>
	<td width=150><div align="center" class="style2">結束日期</div></td>
	<td width=150><div align="center" class="style2">課程總時數</div></td>
	<td width=150><div align="center" class="style2">詳細資料</div></td>
</tr>	

<%
		for (Object obj: couList){
		   Course cou= (Course) obj;
	%>
<tr bordercolor="#6894D5">
	<td height="24"><div align="center" class="style2"><%=cou.getCr_id()%></div></td>
	<td><div align="center" class="style2"><%=cou.getCr_descr()%></div></td>
	<td><div align="center" class="style2"><%=cou.getCr_type()%></div></td>
	<td><div align="center" class="style2"><%=cou.getCr_startdate()%></div></td>
	<td><div align="center" class="style2"><%=cou.getCr_enddate()%></div></td>
	<td><div align="center" class="style2"><%=cou.getCr_hours()%></div></td>
	<td><div align="center" class="style2"><a href='coursedetail?cdetail=<%=cou.getCr_id()%>'>修改</a></div></td>

<% //} %>


</tr>	

<%
	}
%>

</table>
<%
	out.println("<br>");
	out.println("<a href='coursedetail?cdetail='XXXXX' align=right>新增課程</a>");

	out.println("<br><br>");
	out.println("<a href='index.jsp' align=center>回主頁</a>");
 %>
</body>
</center>
</html>
